home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / amiga / asrc29k.lha / nrs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-08  |  1.5 KB  |  43 lines

  1. #ifndef    NRS_ALLOC
  2.  
  3. #include "global.h"
  4.  
  5. #define NRS_MAX 5        /* Maximum number of Nrs channels */
  6.  
  7. /* SLIP definitions */
  8. #define    NRS_ALLOC    40    /* Receiver allocation increment */
  9.  
  10. #define STX    0x02        /* frame start */
  11. #define ETX 0x03        /* frame end */
  12. #define DLE    0x10        /* data link escape */
  13. #define NUL 0x0            /* null character */
  14.  
  15. /* packet unstuffing state machine */
  16. #define NRS_INTER    0        /* in between packets */
  17. #define NRS_INPACK    1        /* we've seen STX, and are in a the packet */
  18. #define NRS_ESCAPE    2        /* we've seen a DLE while in NRS_INPACK */
  19. #define NRS_CSUM    3        /* we've seen an ETX, and are waiting for the checksum */
  20.  
  21. /* net/rom serial protocol control structure */
  22. struct nrs {
  23.     char state;        /* Receiver State control flag */
  24.     unsigned char csum;    /* Accumulating checksum */
  25.     struct mbuf *rbp;    /* Head of mbuf chain being filled */
  26.     struct mbuf *rbp1;    /* Pointer to mbuf currently being written */
  27.     char *rcp;        /* Write pointer */
  28.     int16 rcnt;        /* Length of mbuf chain */
  29.     struct mbuf *tbp;    /* Transmit mbuf being sent */
  30.     long errors;        /* Checksum errors detected */
  31.     long packets ;        /* Number of packets received successfully */
  32.     struct iface *iface ;    /* Associated interface structure */
  33.     int (*send)(int,struct mbuf *);    /* Routine to send mbufs */
  34.     char (*get)(int);    /* Routine to fetch input chars */
  35. };
  36.  
  37. extern struct nrs Nrs[];
  38. /* In nrs.c: */
  39. int nrs_raw __ARGS((struct iface *iface,struct mbuf *bp));
  40. void nrs_recv __ARGS((int dev,void *v1,void *v2));
  41.  
  42. #endif    /* NRS_ALLOC */
  43.